<template>
	<view class="container">
		<view class="service-layout">
			<view class="service-title">客服微信号</view>
			<image src="/static/images/wx_service.png" class="service-icon" :show-menu-by-longpress="true"></image>
		</view>
		<view class="service-layout" v-if="showPic">
			<view class="service-title" style="margin-top: 100rpx;">鲸转文案会员权益</view>
			<image src="/static/images/service_price.jpg" class="service-img" :show-menu-by-longpress="true"></image>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue';
	import { onShow } from '@dcloudio/uni-app';
	import { getDynamicConfig } from '@/utils/api.js';
	
	const showPic = ref(false);
	
	onShow(() => {
		getDynamicConfigFn();
	});
	
	const getDynamicConfigFn = async () => {
		const { data } = await getDynamicConfig({});
		showPic.value = data.showPic;
		uni.setNavigationBarTitle({
			title: data.text,
		});
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100vw;
		display: flex;
		flex-direction: column;
		.service-layout {
			margin-top: 30rpx;
			display: flex;
			flex-direction: column;
			gap: 24rpx;
			align-items: center;
			justify-content: center;
			.service-title {
				font-size: 26rpx;
				font-weight: bold;
				color: #333;
				letter-spacing: 1rpx;
			}
			.service-icon {
				width: 260rpx;
				height: 260rpx;
			}
			.service-img {
				width: 100%;
			}
		}
	}
</style>
